package com.anolesoft.twelveFactory.planManagement.service.impl;

import com.anolesoft.twelveFactory.planManagement.entity.Outsourcing;
import com.anolesoft.twelveFactory.planManagement.mapper.OutsourcingMapper;
import com.anolesoft.twelveFactory.planManagement.service.OutsourcingService;
import com.anolesoft.yr.util.PageData;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OutsourcingServiceImpl extends ServiceImpl<OutsourcingMapper,Outsourcing> implements OutsourcingService {

    @Resource
    private OutsourcingMapper outsourcingMapper;

    @Override
    public PageData<List<Outsourcing>> listOutsourcing(Outsourcing outsourcing) {
        Page<Outsourcing> page = new Page<Outsourcing>(outsourcing.getPageNo(), outsourcing.getPageSize());
        List<Outsourcing> listOutsourcing=outsourcingMapper.listOutsourcing(outsourcing,page);
        return new PageData<>(((int) page.getTotal()), listOutsourcing);
    }
    @Override
    public Outsourcing selectById(String objuid) {
        return this.outsourcingMapper.selectById(objuid);
    }
}
